<template>
  <MdPreview 
   :onGetCatalog="onGetCatalog" 
   :onHtmlChanged="onHtmlChanged"
    :editorId="id" 
    id="nim"
   :modelValue="sanitize(body)"  
   theme="dark" 
   style="min-height: 1000px;width:100%; background-color: rgb(36, 36, 36); "/>

  </template>
  
  <script setup lang="ts">

  import { defineProps } from 'vue';
  import { MdPreview } from 'md-editor-v3';
  import {ArticleStore} from '../store/articelStore/index'
  import 'md-editor-v3/lib/preview.css';
  import {sanitize} from '../filter/index'
  defineProps(["body"])
  const id = 'preview-only';
  const articleStore = ArticleStore()



const onHtmlChanged = (_h: string)=>{


}
const onGetCatalog = (list: any) => {
  articleStore.articleCatalogs = list
    
  }
  </script>